<% form_tag url_for(:controller => "search", :action => "q"), :method => :get do -%>
<input name="k" type="text" size="30" maxlength="72" value="<%= params[:k]%>" id="page_focus"/>
<% 
   @categories = PostCategory.find(:all, :conditions => [ "parent_id = 0"], :order => "position DESC").map{|u| [u.title, u.id]} 
   @categories << ["全部", 0]
%>
<% if params[:cid].nil? || params[:cid] == 0%>
  <%= select_tag( 'cid', options_for_select(@categories, ["全部", 0])) %>
<% else %>
    <%= select_tag( 'cid', options_for_select(@categories, ["全部", 0])) %>
<% end %>
<input type="submit" value="搜索"/>
<% end -%>